<template>
  <Person ref="ren"></Person>
  <button @click="test">获取子组件Person的数据</button>
</template>

<script lang="ts" setup name="App">
  import Person from './components/Person.vue'
  import { ref } from 'vue'

  let ren = ref()

  function test() {
    console.log(ren.value.name);
    console.log(ren.value.age);
  }


</script>

<style scoped></style>
